export default class Stack{
    private items:Map<number,any>
    private count:number;
    private items2:Map<any,number>

    constructor(){
        this.items=new Map()
        this.items2=new Map()
        this.count=0
    }
    push(item:any){
        this.items.set(this.count,item)
        this.items2.set(item,this.count++)
    }
    pop(){
        let res=this.items.get(--this.count)
        this.items2.delete(res)
        this.items.delete(this.count)
        return res
    }
    peek(){
        return this.items.get(this.count-1)
    }
    isEmpty(){
        return this.items.size==0
    }
    size():number{
        return this.items.size
    }
    hasItem(item:any):boolean{
        return this.items.has(item)
    }
    find(){

    }
    toString(){

    }
}